package homework;
import java.math.BigInteger;
import java.util.Scanner;
public class Test_BigNumbser {
    public static void main(String[] args) {
        //接收输入
        System.out.println("请输入第一个数字：");
        Scanner scanner = new Scanner(System.in);
        String n1 = scanner.next();
        System.out.println("请输入第二个数字：");
        String n2 = scanner.next();
        //在输入运算符
        String op = scanner.next();
        BigInteger b1 = new BigInteger(n1);
        BigInteger b2 = new BigInteger(n2);
        if(op.equals("+")){
            System.out.println(b1.add(b2));
        }else if(op.equals("-")){
            System.out.println(b1.subtract(b2));
        }else if(op.equals("*")){
            System.out.println(b1.multiply(b2));
        }else if(op.equals("/")){
            if(b2.toString().equals("0")){
                System.out.println("除数不能为0");
            }else{
                System.out.println(b1.divide(b2));
            }
        }else{
            System.out.println("输入的运算符有误");
        }
    }
}
